package com.cdgc.web.service.Impl;

import com.cdgc.web.mapper.GysMapper;
import com.cdgc.web.pojo.Gys;
import com.cdgc.web.service.GysService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GysServiceImpl implements GysService {
    @Resource
    private GysMapper gysMapper;
    @Override
    public List<Gys> queryAllGys() {
        return gysMapper.selectByExample(null);
    }

    @Override
    public void addNewGys(Gys gys) {
        gysMapper.insert(gys);
    }

    @Override
    public void deleteGysById(Integer id) {
        gysMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void UpdateGys(Gys gys) {
        gysMapper.updateByPrimaryKey(gys);
    }

    @Override
    public Gys queryGysById(Integer id) {
        return gysMapper.selectByPrimaryKey(id);
    }
}
